 <template>
  <div class="profater">
    profater
    <ProSun name="ys" :age="28" sex="man"></ProSun>
    <hr>
    <ProSun name="ll" @SunBtnClick="ClickFun" ref="sunFunRef"></ProSun>
    <hr>
    <router-link to="/profile/Message">跳转message</router-link>
    <hr>
    <router-link to="/profile/about">跳转about</router-link>
      <router-view></router-view>
  </div>
 </template>
 <script setup>
 import ProSun from './ProSun.vue'
 import { ref,onMounted } from 'vue'
 function ClickFun(payload){
  console.log("子组件通过点击事件触发 emit 事件 emits 触发 SunBtnClick 事件 父组件监听到事件触发了就执行ClickFun方法，",payload);
 }

 const sunFunRef = ref()
 onMounted(() => {
    console.log("sunFunRef",sunFunRef.value);
    sunFunRef.value.sunFun()
    sunFunRef.value.sunFun2()
 })

 </script>
 <style lang="less" scoped>
 
 </style>